<!DOCTYPE html>
<html lang="en">
<head>
    <title>全景图补天小行星视角</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <style>
        body {
            margin: 0px;
            overflow: scroll;
        }
        #example {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
        }
    </style>
</head>
<body>
<div id="example"></div>
<script src="../build/three.js"></script>
<script src="../build/mxreality.js"></script>

<script>
    var  scene, renderer;
    var container;
    var vr=null;
    var cubeCamera2;
    function init() {
        renderer = new THREE.WebGLRenderer();
        container = document.getElementById('example');
        container.appendChild(renderer.domElement);


        scene = new THREE.Scene();
        AVR.debug=true;
        vr=new VR(scene,renderer,container,{'fov':60});
        vr.asteroidConfig.enable=true;
        vr.asteroidConfig.cubeResolution=1024;
        vr.asteroidConfig.assteroidFov=100;
        //vr.asteroidConfig.asteroidTop=-1;
        vr.vrbox.width=50;
        vr.vrbox.height=50;
        vr.vrbox.depth=50;


        vr.sliceSegment=2;
        vr.loadProgressManager.onLoad=function () {
            vr.VRObject.getObjectByName("__mxrealitySlice").visible = true;
            vr.asteroidForward();
        }
        vr.loadProgressManager.onProgress=function () {
            
        }

        vr.init(function () {

        });

        vr.sphere2BoxPano("textures/puydesancy.jpg",1024,1024,function (sliceArray) {
            vr.playPanorama(sliceArray, vr.resType.slice);
        });
        //vr.playPanorama("http://ov4hj29xx.bkt.clouddn.com/puydesancy.jpg");

    }
    init();

</script>
</body>
</html>
